{// 引入标签库 }
<tagLib name="fanwe" />
{// 加载头部公共文件 }
<include file="Public:header" />
<script type="text/javascript" src="__TMPL__ThemeFiles/Js/calendar.php?lang=zh-cn" ></script>
<load href='__TMPL__ThemeFiles/Js/calendar/calendar.css' />
<load href="__TMPL__ThemeFiles/Js/jquery.js" />
<load href="__TMPL__ThemeFiles/Js/jquery.json.js" />
<load href='__TMPL__ThemeFiles/Css/jqModal.css' />
<load href='__TMPL__ThemeFiles/Js/jqModal.js' />
<load href='__TMPL__ThemeFiles/Js/common.js' />

<div class="title">
	付款状态:&nbsp;{$vo.money_status_name}&nbsp;&nbsp;&nbsp;发货状态:&nbsp;{$vo.goods_status_name}&nbsp;&nbsp;&nbsp;
</div>

<FORM METHOD=POST id="form_profit" action="{:u('Order/save_profit')}">
<table cellpadding=0 cellspacing=0 class="dataEdit" >
<TR>
	<TD class="tRight" >订单号：</TD>
	<TD class="tLeft" >
		{$vo.sn}
	</TD>
	
	<TD class="tRight" >下单日期：</TD>
	<TD class="tLeft" >{$vo.create_time}</TD>	
</TR>

<TR>
	<TD class="tRight" >已收金额：</TD>
	<TD class="tLeft" >
		<INPUT TYPE="text" NAME="order_incharge" id="order_incharge" readonly value="{$vo.order_incharge}">({$vo.order_total_price})
	</TD>
	
	<TD class="tRight" >商品成本：</TD>
	<TD class="tLeft" >
		<INPUT TYPE="text" NAME="cost_total_price" id="cost_total_price"  value="{$vo.cost_total_price}">
	</TD>		
</TR>

<TR>
	<TD class="tRight" >配送成本：</TD>
	<TD class="tLeft" >
		<INPUT TYPE="text" NAME="cost_delivery_fee" id="cost_delivery_fee" value="{$vo.cost_delivery_fee}" onblur = "calc_profit()" >
	</TD>
	
	<TD class="tRight" >保价成本：</TD>
	<TD class="tLeft" >
		<INPUT TYPE="text" NAME="cost_protect_fee" id="cost_protect_fee" value="{$vo.cost_protect_fee}" onblur = "calc_profit()">
	</TD>	
</TR>

<TR>
	<TD class="tRight" >支付手续费：</TD>
	<TD class="tLeft" >
		<INPUT TYPE="text" NAME="cost_payment_fee" id="cost_payment_fee" value="{$vo.cost_payment_fee}" onblur = "calc_profit()">
	</TD>
	
	<TD class="tRight" >其它成本：</TD>
	<TD class="tLeft" >
		<INPUT TYPE="text" NAME="cost_other_fee" id="cost_other_fee" value="{$vo.cost_other_fee}" onblur = "calc_profit()">
	</TD>	
</TR>

<TR>
	<TD class="tRight" >成本合计：</TD>
	<TD class="tLeft" >
		<INPUT TYPE="text" NAME="cost_total" id="cost_total"  readonly value="0">
	</TD>
	
	<TD class="tRight" >本单利润：</TD>
	<TD class="tLeft" >
		<INPUT TYPE="text" NAME="order_profit" id="order_profit" readonly value="{$vo.order_profit}">
	</TD>	
</TR>

<TR>
	<TD class="tRight tTop" >备注：</TD>
	<TD class="tLeft" colspan = 3 >
		<TEXTAREA class="large bLeft"  NAME="adm_memo" ROWS="3" COLS="70">{$vo.adm_memo}</TEXTAREA>
	</TD>	
</TR>
<TR>
	<TD class="center" colspan = 4>
	<INPUT TYPE="hidden" name="id" value="{$vo.id}" >
	<INPUT TYPE="submit" value="保 存" class="button">
	<INPUT TYPE="button" class="button" onclick="javascript:history.back(1)" value="关闭" >
	</TD>
</TR>
</TABLE>
</FORM>

<script type="text/javascript">
	function calc_profit(){
		$("#cost_total").attr("value", round($("#cost_total_price").val(), 3) + round($("#cost_delivery_fee").val(), 3) + round($("#cost_protect_fee").val(), 3) 
				   + round($("#cost_payment_fee").val(), 3) + round($("#cost_other_fee").val(), 3));

		$("#order_profit").attr("value", round($("#order_incharge").val(), 3) - round($("#cost_total").val(), 3));
	}

	calc_profit();	
</script>
